#ifndef __BIRD__
#define __BIRD__

#include "GameObject.h"

#define BIRD_VX 100
#define BIRD_VY_FLY 300
#define G -900;

enum BirdState
{
	BS_WAIT,
	BS_FLY,
	BS_DIE,
	BS_IN_GROUND,
};

class Bird : public GameObject
{
public:
	Bird();
	~Bird();

	CREATE_FUNC(Bird);
	bool init();
	void flyAnimate();
	void flyUp();
	void updateCameraPosition(int cameraX);

	CCSprite* sprite;
	CCRotateTo* rotateTo90Action;
	CCRotateTo* rotateUpAction;
	bool isRotatingTo90;

	CCPoint v;
	CCPoint a;
	
	void setState(int state);
	void reset();
	void setAngle(float angle);
	void rotateTo90();
	void rotateUp();
private:
	float angle;
	void update(float delta);
	void rotateDoneCallback();
};

#endif // !__BIRD__
